package com.cn.pg.controller;

import com.cn.pg.config.RoutingWith;
import com.cn.pg.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProductController {

    @Autowired
    private ProductService productService;

    @GetMapping("/findAllProductM")
    public String findAllProductM() {
        productService.findAllProductM();
        return "master";
    }

    @GetMapping("/findAllProductS")
    @RoutingWith("slave")
    public String findAllProductS() {
        productService.findAllProductS();
        return "slave";
    }

}
